package me.zhengjie.modules.system.service.impl;

import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.system.domain.ProjectApproval;
import me.zhengjie.modules.system.repository.ProjectApprovalRepository;
import me.zhengjie.modules.system.service.ProjectApprovalService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
@CacheConfig(cacheNames = "projectApproval")
public class ProjectApprovalServiceImpl implements ProjectApprovalService {

    private final ProjectApprovalRepository projectApprovalRepository;

    @Override
    public void save(ProjectApproval projectApproval) {
        projectApprovalRepository.save(projectApproval);
    }

    @Override
    public List<ProjectApproval> list(String name) {
        return projectApprovalRepository.list(name);
    }

    @Override
    public void delete(Long id) {
        projectApprovalRepository.deleteById(id);
    }
}
